FIG. 10 is a diagram illustrating a system configuration and a layer configuration of a general serial transmission apparatus which performs serial transmission. In FIG. 10, an apparatus 110 and an apparatus 210 are connected to each other through a serial communication line 310 and perform data transmission/reception through the serial communication line 310.
Examples of a serial transmission method include a method having a three-layer structure. In the example illustrated in FIG. 10, each of the apparatuses 110 and 210 has a physical layer, a link layer, and an upper layer. Here, the physical layer controls transmission/reception of a communication packet through the serial communication line 310. The link layer logically controls data transmission/reception through the serial communication line 310. The upper layer generates a communication packet and obtains communication data from and supplies communication data to software. A data transfer method using PCI Express which is a concrete example of the transfer method having a three-layer structure has a physical layer (PL), a data link layer (DLL), and a transaction layer (TL) for example.
The physical layer performs data transfer between the link layer and the serial communication line and performs a control process for establishment of a connection of the serial communication line. The control process performed on the serial communication line includes a link recovery process performed when an error occurs in the serial communication line.
The link layer performs control for ensuring data transmission between a pair of apparatuses. The link layer receives a transaction layer packet (TLP) from the upper layer and adds a sequence number (SEQ) to the TLP. Data of the TLP including the sequence number added thereto is transmitted to the counterpart apparatus through the physical layer.
The link layer has, in addition to a function of transmitting the TLP, a function of determining completion of a transmission in accordance with a normal/abnormality notification, a function of detecting a time-out, and a function of transmitting data again as data transmission functions. Furthermore, the link layer has, in addition to a function of receiving data, a function of determining whether received data is normal or abnormal and transmitting a result of the determination as a normal/abnormality notification to the counterpart apparatus as a data reception function. Each of the apparatuses may serve as a data transmitter and a data receiver, and therefore, the link layer included in each of the apparatuses has the data transmission function and the data reception function. Since the link layer has the data transmission function and the data reception function, data transmission is more reliably performed. Hereinafter, the data transmission function and the data reception function of the link layer will be described in detail.
The normal/abnormality notification generated by the link layer is transmitted to the counterpart apparatus using a data link layer packet (DLLP) used to manage a transmission path (link). As a normality notification, that is, an affirmative response used for a notification of normal reception of one or more TLPs, an ACK DLLP is used. As an abnormality notification, that is, a negative response used to request retransmission of a TLP, a NAK DLLP is used.
A reception apparatus determines whether a received TLP is normal and notifies a transmission apparatus of a result of the determination using an ACK/NAK DLLP. When successfully receiving the TLP, the reception apparatus adds a sequence number of the latest TLP which has been successfully received to ACK DLLP and transmits the ACK DLLP to the transmission apparatus.
In the transmission apparatus, the TLP transmitted through the physical layer is stored in a retry buffer, a transmission buffer, or the like until transmission confirmation is performed using the ACK/NAK DLLP supplied from the reception apparatus. The TLP stored in the retry buffer is used for retransmission of the TLP to be performed when the reception apparatus does not successfully receive the TLP.
When receiving the ACK DLLP from the reception apparatus, the transmission apparatus discards a TLP in which a transmission thereof is confirmed by the ACK DLLP among TLPs stored in the retry buffer. Specifically, a TLP having a sequence number notified using the ACK DLLP and TLPs having sequence numbers before the sequence number notified using the ACK DLLP are discarded. When receiving the NAK DLLP from the reception apparatus, the transmission apparatus discards a TLP in which a transmission thereof is confirmed from the retry buffer and TLPs in which transmissions thereof are not confirmed, that is, TLPs remaining in the retry buffer are transmitted again. After the TLP which has been transmitted is discarded from the retry buffer, a buffer region of the retry buffer corresponding to the discarded TLP is released.
In the transmission apparatus, when a transmission confirmation is not returned from the transmission destination apparatus within a specified period of time after the transmission of the TLP, the TLPs stored in the retry buffer in which transmissions thereof have not been confirmed are transmitted again in an order from the oldest TLP.
In the transmission apparatus, when a transmission confirmation is not transmitted from the transmission destination apparatus even though a retransmission of the TLP is performed several times, it is determined that a link is not working normally. In this case, the link layer of the transmission apparatus instructs the physical layer to perform a retraining process on the link. The physical layer which received the instruction for the re-training causes a state machine which manages a link state to enter a recovery state so that a link recovery process is performed to recover the link to a normal state.
The reception apparatus transmits a NAK DLLP when the physical layer detects an error or when a Cyclic Redundancy Check (CRC) error is detected. When the sequence number of the received TLP is equal to or smaller than a sequence number to be received next, the reception apparatus transmits an ACK DLLP. When the sequence number of the received TLP is equal to or smaller than the sequence number to be received next, the received TLP is determined as an overlapped received TLP and is discarded. When the sequence number of the received TLP is larger than the sequence number to be received next, the reception apparatus transmits a NAK DLLP.
By the DLLP response process, the TLP retransmission process, and the like, performed by the transmission apparatus and the reception apparatus described above, more reliable data transmission is performed. A description will be made with reference to FIGS. 11 to 13 hereinafter.
FIG. 11 is a diagram illustrating a processing flow performed when data transmission is successfully performed. In FIG. 11, the upper layer is denoted by “TL”, the link layer is denoted by “DLL”, and the physical layer is denoted by “PL”. FIG. 11 is a diagram illustrating TLs, DLLs, and PLs of a transmission apparatus A and a reception apparatus B and illustrating performance of data transmission and response. An axis of abscissa illustrated in FIG. 11 denotes a time axis.
In FIG. 11, the apparatus A generates data (TLP) in the TL at a time T1, adds a sequence number (SEQ) “10” to the generated TLP in the DLL, and transmits the TLP to the apparatus B through the PL. The apparatus B successfully receives the TLP transmitted from the apparatus A at a time T2 and transmits an ACK DLLP response representing that a result of the reception is normal and the sequence number “10” to the apparatus A. When receiving the ACK DLLP response supplied from the apparatus B at a time T3, the apparatus A recognizes that a data transmission process corresponding to the sequence number “10” has been successfully performed. Thereafter, the apparatus A adds a sequence number “11” to a TLP transmitted next, and transmits the TLP to the apparatus B. By a similar procedure, the apparatus A receives an ACK DLLP response from the apparatus B at a time T6, and a data transmission process corresponding to the sequence number “11” is completed.
FIG. 12 is a diagram illustrating a processing flow performed when an error occurs in data transmission. The apparatus A adds a sequence number “10” to a TLP and transmits the TLP to the apparatus B at a time T1. However, when a CRC error occurs for some reason in the transmission path, it is likely that data transmitted from the apparatus A is not successfully received by the apparatus B at a time T2. In this case, the apparatus B transmits a NAK DLLP response representing that the TLP has not been successfully received by the apparatus A. A sequence number “9” of a TLP which is the last TLP which has been successfully received by the apparatus B is added to the NAK DLLP response.
When receiving the NAK DLLP response at a time T3, the apparatus A recognizes that the transmission of the TLP corresponding to the sequence number “10” has not been successfully performed, and transmits the TLP which has been stored in the retry buffer again at a time T4. The TLP which is transmitted again at a time T4 is successfully received by the apparatus B at a time T5, and the apparatus B transmits an ACK DLLP response to the apparatus A. Thereafter, the apparatus A receives the ACK DLL response from the apparatus B at a time T6, and a data transmission process corresponding to the sequence number “10” is completed.
FIG. 13 is a diagram illustrating a processing flow performed when a time-out occurs in data transmission. The apparatus A adds a sequence number “10” to a TLP and transmits the TLP to the apparatus B at a time T1. The apparatus B successfully receives the TLP from the apparatus A at a time T2 and transmits an ACK DLLP response to the apparatus A at a time T3. However, it is possible that the ACK DLLP response disappears for some reason in the link path. In this case, when the apparatus A recognizes that a specified period of time has been elapsed using a timer counter or the like, a time-out (T.O.) occurs (at a time T4).
When the time-out occurred in the apparatus A, that is, when a transmission confirmation is not transmitted from the apparatus B within a specified period of time, the apparatus A transmits the TLP which has been stored in the retry buffer again (at a time T5). The TLP which is transmitted again at a time T5 is successfully received by the apparatus B at a time T6, and the apparatus B transmits an ACK DLLP response to the apparatus A. Thereafter, the apparatus A receives the ACK DLL response from the apparatus B at a time T7, and a data transmission process corresponding to the sequence number “10” is completed.
Related art is disclosed in Japanese Laid-open Patent Publication No. 2-285752.
Here, a link recovery process is performed when an error occurs in the serial communication line, and therefore, it is possible that a TLP transmitted from the link layer of the transmission apparatus is lost. In this case, data transmission is completed after the link layer of the transmission apparatus detects a time-out, and therefore, a period of time longer than a time-out period is needed for completion of the data transmission after the link recovery process. Hereinafter, the time-out of the link layer is denoted by “RTO”.
The physical layer performs the link recovery process when an error occurs in the communication line. While the link recovery process is performed, the physical layer stops data transmission from the link layer. Here, since the link layer is independent from the physical layer, the link layer may transmit data to the physical layer before the physical layer performs the link recovery process. In this case, the data transmitted from the link layer is discarded in the physical layer while the physical layer is in the link recovery process.
As described above, if a timing when the link recovery process is performed in the physical layer competes against a timing when the data transmission is performed, data transmitted from the link layer may be lost. When the data transmitted from the link layer is lost, the data is transmitted again when the time-out detection of the link layer after a time-out period is elapsed.
FIG. 14 is a diagram illustrating a processing flow performed when a transmission TLP is lost. In the example illustrated in FIG. 14, the apparatus A transmits a TLP including a sequence number “10” added thereto to the physical layer at a time T1. At this time, at a time T2 immediately after the time T1, performance of the link recovery process is started on the communication line. In the link recovery process in the physical layer, the physical layers of the apparatuses A and B perform transmission/reception of a training sequence packet (TS packet) used to perform the link recovery process. The transmission/reception of the TS packet is performed by a physical layer packet (PLP) used to perform transmission between the physical layers.
In FIG. 14, the TLP transmitted from the link layer of the apparatus A is discarded in the physical layer since the physical layer is in the link recovery process. Therefore, a time-out (RTO) occurs in the link layer of the apparatus A (at a time T4). When the time-out (RTO) occurs, the link layer of the apparatus A recognizes that the TLP corresponding to the sequence number “10” has not been successfully transmitted and transmits data of the TLP which has been stored in the retry buffer again at a time T5. The TLP transmitted again is received by the apparatus B at a time T6, and an ACK DLLP response transmitted from the apparatus B is received by the apparatus A at a time T7 whereby a process of transmitting the TLP corresponding to the sequence number “10” is completed.
In the example illustrated in FIG. 14, the communication line is not allowed to be used in a period of time from the time T2 to the time T3 in which the physical layer has been performing the link recovery process, and therefore, retransmission of the TLP is suspended. However, in a period of time from the time T3 to the time T4 before the time-out is detected, the retransmission of the TLP does not have to be suspended. Accordingly, in this period of time, the time is unnecessarily wasted if the retransmission of the TLP is suspended.
FIG. 15 is a diagram illustrating a processing flow performed when a normal/abnormality notification (DLLP) is lost. In the example illustrated in FIG. 15, a TLP is transmitted from the apparatus B to the apparatus A at a time T1 and the apparatus A successfully receives the TLP at a time T2. Thereafter, the link layer of the apparatus A transmits an ACK DLLP to the apparatus B. However, at a time T3 immediately after the time T2, the physical layers start the link recovery process on the communication line, and therefore, the ACK DLLP transmitted by the link layer of the apparatus A is discarded by the physical layer of the apparatus A. In this case, the link layer of the apparatus B is not allowed to receive a response representing transmission confirmation from the apparatus A, and accordingly, a time-out (RTO) occurs at a time T5.
The apparatus B which detected the time-out at the time T5 determines that the TLP has not been successfully transmitted and transmits data of the TLP which has been stored in the retry buffer again. In this case, since the TLP corresponding to a sequence number “10” has been received by the apparatus A, the apparatus A discards the TLP received at a time T6 and transmits the ACK DLLP corresponding to the sequence number “10” to the apparatus B again.
Also in the example illustrated in FIG. 15, the communication line is not allowed to be used in a period of time from the time T3 to the time T4 in which the physical layer has been performing the link recovery process, and therefore, retransmission of the TLP is suspended. However, in a period of time from the time T4 to the time T5 before the time-out is detected, the retransmission of the TLP does not have to be suspended. Accordingly, in this period of time, the time is unnecessarily wasted if the retransmission of the TLP is suspended.
As described in the examples illustrated in FIGS. 14 and 15, in general, when data transmitted from the link layer is discarded while the physical layer is in the link recovery process, the link layer recognizes the lost transmitted data only by detecting a time-out (RTO). Specifically, there arises a problem in that, when the data transmitted from the link layer is lost, the data transmission is not completed until the time-out (RTO) time is reached in principle.